//
//  ViewController.m
//  learnProject
//
//  Created by 吴斌 on 2022/8/8.
//

#import "ViewController.h"
#import "WBPerson.h"
#import <objc/runtime.h>

@interface ViewController ()

@end


@implementation ViewController



- (void)viewDidLoad {
    [super viewDidLoad];
    
    //可变数组插入nil的处理
    NSString *obj = nil;
    
    
//    1、数组
    NSMutableArray *array = [NSMutableArray array];
    
//    __NSArrayM
//    NSLog(@"%@", [array class]);
    
    [array addObject:@"jack"];
    [array addObject:obj];
    [array insertObject:obj atIndex:0];
    
    NSLog(@"%@", array);
    
    
   
//    2、字典
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    dict[@"name"] = @"jack";
    dict[obj] = @"rose";
    dict[@"age"] = obj;
    
//    NSDictionary *dict = @{@"name" : [[NSObject alloc] init],
//                           @"age" : @"jack"};
//    NSString *value = dict[nil];
    
    NSLog(@"%@",dict);
    
//    3、批量修改字体大小
//    [UIFont systemFontOfSize:12 * 1.1];
    
    
    //方法交换基础知识
//    WBPerson *person = [[WBPerson alloc] init];
//
//    Method runMethod = class_getInstanceMethod([WBPerson class], @selector(run));
//    Method testMethod = class_getInstanceMethod([WBPerson class], @selector(test));
//
//    method_exchangeImplementations(runMethod, testMethod);
//
//    [person test];
    
}



- (IBAction)click2 {
    NSLog(@"%s", __func__);
}

- (IBAction)click1 {
    NSLog(@"%s", __func__);
}

- (IBAction)click3 {
    NSLog(@"%s", __func__);
}






@end
